<?php

    if($_GET["debug"]==2){
        include "/var/www/html/new/d/tpl/terminal_new/terminal.html";
        exit;
    }

    //已过期订单大部分是不能验证的   除非是admin帐号
    //1: 可以验证   0:不能验证
	$isAdmin = ($_SESSION['sid'] == 1) ? 1 : 0;
?>
<link rel="stylesheet" href="http://www.12301.cc/css/common/www.12301.cc.global.css"/>
<link rel="stylesheet" href="http://www.12301.cc/css/terminal_dev.css"/>
<link rel="stylesheet" href="http://www.12301.cc/css/ui/Calendar.css"/>
<style type="text/css">
	.calendar{ position:fixed; top:314px; width:550px; z-index:1000; background:#f0f1f3}
	.calendar .title{ position:relative}
	.calendar table td div.detail{ height:40px; }
	.calendar table th{ text-align:center}
	.calendar table td span{ width:100%; height:100%; float:none; line-height:40px; text-align:center; float:none}
</style>
<!--[if lt IE 7]><div id="terminalWrap" class="lt-ie10 lt-ie9 lt-ie8 lt-ie7 ie6 terminalWrap"> <![endif]-->
<!--[if IE 7]><div id="terminalWrap" class="lt-ie10 lt-ie9 lt-ie8 ie7 terminalWrap"> <![endif]-->
<!--[if IE 8]><div id="terminalWrap" class="lt-ie10 lt-ie9 ie8 terminalWrap"> <![endif]-->
<!--[if IE 9]><div id="terminalWrap" class="lt-ie10 ie9 terminalWrap"><![endif]-->
<!--[if gt IE 9]><!--><div id="terminalWrap" class="terminalWrap"> <!--<![endif]-->
	<input name="" type="hidden" id="isAdmin" value="<?=$isAdmin?>"/>
	<input id="gsid" name="" type="hidden" value="<?=$_GET['sid']?>"/>
	<div class="termTopTit"><span class="title">票券验证</span></div>
	<div class="prodBox">
		<div id="prodPhoto" class="prodPhoto">
			<img id="" class="loading" src="http://www.12301.cc/images/icons/gloading.gif" alt=""/>
			<img class="error" src="http://www.12301.cc/images/defaultThum.jpg" alt=""/>
		</div>
		<div class="prod">
			<div class="prodDetail">
				<span class="col"><em class="lt">产品ID：</em><span id="term_prodId" class="rt">--</span></span>
				<span class="col"><em class="lt">终端号：</em><span id="term_termNum" class="rt">--</span></span>
				<span class="col"><em class="lt">产品编号：</em><span id="term_prodNum" class="rt">--</span></span>
			</div>
			<div class="prodList">
				<span class="t">选择产品：</span>
				<input id="prodSearchInp" class="prodSearchInp" type="text"/>
			</div>
			<!--<div class="prodList" style="margin-top:6px"><span class="t">验证时间：</span><input id="termDateInp" class="termDateInp" type="text"/></div>-->
		</div>
		<div id="prodBoxStatus" class="prodBoxStatus"></div>
	</div>

    <? if($_GET["debug"]==2): ?>
        <ul id="tabUl" class="tabUl">
            <li data-type="fast" class="tabLi fast active">快速验证</li>
            <li data-type="normal" class="tabLi normal">改单验证</li>
            <li data-type="overdue" class="tabLi overdue">已过期订单验证</li>
        </ul>
    <? endif; ?>
    <div id="tabMainCon" class="tabMainCon">
        <? if($_GET["debug"]==2): ?>
        <div class="tabPanelCon fast">
            <div class="entryTop">
                <input id="fastTermInp" class="fastTermInp" type="text" placeholder="凭证码 / 手机号"/>
                <a id="fastTermBtn" class="fastTermBtn" href="javascript:;">验证</a>
                <span class="keyEnterTip">可按回车键直接验证</span>
            </div>
            <ul id="fastTermResUl" class="fastTermResUl orderList">
            </ul>
        </div>
        <? endif; ?>
        <div class="tabPanelCon normal">
            <div id="termContainer" class="termContainer">
                <input id="termSearInp" class="termSearInp" value="<?=$_GET['chk']?$_GET['chk']: '凭证码 / 手机号 '?>" type="text"/><input type="button" id="termSearBtn" class="termSearBtn" value="搜索"/>
                <span class="keyEnterTip">可按回车键直接搜索</span>
                <ul id="myOrderList" class="orderList"></ul>
            </div>
            <ul id="prodListUl" class="prodListUl"></ul>
        </div>
        <? if($_GET["debug"]==2): ?>
            <div class="tabPanelCon overdue">
                <div class="entryTop">
                    <input id="fastTermInp" class="fastTermInp" type="text" placeholder="已过期订单只能使用订单号验证"/>
                    <a id="fastTermBtn" class="fastTermBtn" href="javascript:;">验证</a>
                    <span class="keyEnterTip">可按回车键直接验证</span>
                </div>
                <ul id="fastTermResUl" class="fastTermResUl orderList">
                </ul>
            </div>
        <? endif; ?>
    </div>
	<script type="text/javascript" src="http://www.12301.cc/js/global/www.12301.cc.global.js"></script>
	<script type="text/javascript" src="http://www.12301.cc/js/terminal/TerminalCore.js"></script>
    <?php if($var['canmod']==1):?>
        <script type="text/javascript" src="http://www.12301.cc/js/terminal/terminal-pc.js"></script>
    <?php else:?>
        <script type="text/javascript" src="http://www.12301.cc/js/terminal/terminal-pc-nomodify.js"></script>
    <?php endif;?>
	<script type="text/javascript" src="http://www.12301.cc/js/class/CalendarCore.js"></script>
</div>
<div id="calendarContainer" style="display:none" class="calendar"></div>
<script type="text/javascript">
	$(function(){ new Terminal() })
</script>